package test1230am;

public class Test13 {
    public static void main(String[] args) {
        // (13)定义实现m方法：求数组中元素和
        int[] arr = {1,2,3,4,5};
        int sum = m(arr);
        System.out.println(sum);
    }
    public static int m(int[] arr) {
        int sum = 0;
        for (int i = 0; i < arr.length; i++) {
            sum += arr[i];
        }
        return sum;
    }
}
